import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn } from 'typeorm';
import { ApiProperty } from '@nestjs/swagger';

@Entity('h5_configs')
export class H5Config {
  @ApiProperty({ description: '配置ID' })
  @PrimaryGeneratedColumn()
  id: number;

  @ApiProperty({ description: '配置键' })
  @Column({ length: 100, unique: true })
  configKey: string;

  @ApiProperty({ description: '配置值' })
  @Column({ type: 'text' })
  configValue: string;

  @ApiProperty({ description: '配置描述' })
  @Column({ length: 500, nullable: true })
  description: string;

  @ApiProperty({ description: '配置类型' })
  @Column({ length: 50, default: 'string' })
  type: string;

  @ApiProperty({ description: '状态：0-禁用，1-启用' })
  @Column({ default: 1 })
  status: number;

  @ApiProperty({ description: '创建时间' })
  @CreateDateColumn()
  createdAt: Date;

  @ApiProperty({ description: '更新时间' })
  @UpdateDateColumn()
  updatedAt: Date;
}
